<html><head><title>HTML Filters and Forms</title><meta name="filename" content="text/common/02/01170700"/><meta name="language" content="en-US"/><help:css-file-link xmlns:help="http://openoffice.org/2000/help"/><!--The CSS style header method for setting styles--><style type="text/css">
p.P1{
}
</style></head><body>
<p class="P1"/>
<p class="Head1"><help:key-word value="forms; HTML filters" tag="kw65995_1" xmlns:help="http://openoffice.org/2000/help"/>HTML Filters and Forms</p>
<p class="Paragraph">You can now use all control element and form events in HTML documents. There have been numerous events to date (e.g. the focus events), which have not been changed at all. They will continue to be imported and exported as ONFOCUS, ONBLUR, etc. for JavaScript and as SDONFOCUS, SDONBLUR, etc. for <help:productname xmlns:help="http://openoffice.org/2000/help">%PRODUCTNAME</help:productname> Basic.</p>
<p class="Paragraph">Generic names that consist of the Listener interface and the method name of the event are used for all other events: An event registered as XListener::method is exported as</p>
<p class="Paragraph">The XListener- and method components of this option are case sensitive!</p>
<p class="Paragraph">Event handling of controls is performed using the <help:productname xmlns:help="http://openoffice.org/2000/help">%PRODUCTNAME</help:productname> API. If you assign an event to a control, an object registers itself internally as a "Listener" for a specific control event. <text:s text:c="" xmlns:text="http://openoffice.org/2000/text"/>To do this, the object must use a specific interface, for example the XFocusListener Interface, so that it can react to focus events. When the event occurs, the control then invokes a special method of the Listener interface, for example focusGained, when the control receives the focus. The internally registered object then invokes the JavaScript or <help:productname xmlns:help="http://openoffice.org/2000/help">%PRODUCTNAME</help:productname> Basic code, which was assigned to the event.</p>
<p class="Paragraph">The HTML filter now uses precisely these listener interfaces and method names so that it can import and export events as desired. Thus you can register a focus event via</p>
<p class="Paragraph">register. Events can thus be registered as desired, including those not offered in the list boxes. To define the script language of events, you may write the following line in the document header:</p>
<p class="Paragraph">As CONTENT you can, for example, use "text/x-StarBasic" for <help:productname xmlns:help="http://openoffice.org/2000/help">%PRODUCTNAME</help:productname> Basic or a "text/JavaScript" for JavaScript. If no entry is made, JavaScript is assumed.</p>
<p class="Paragraph">During exporting, the default script language will be defined based on the first module found in macro management. Thus (for events) only one language can be used per document.</p>